<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends CommonController 
{
	//后台首页
    public function index()
    {
        $this->display();
    }

    //桌面
    public function welcome()
    {
        $admin_info = M('admins')->where(array('id'=>$_SESSION['id']))->find();
        $this->assign('admin_info',$admin_info);

    	$this->display();
    }

    //最新老师注册
    public function zhuce_ls_iframe()
    {
        $laoshi_user = M('laoshi_user')->field('phone,sfz_name,city,create_time')->order('create_time desc')->limit(5)->select();
        $this->assign('laoshi_user',$laoshi_user);

        $this->display();
    }

    //最新家长注册
    public function zhuce_jz_iframe()
    {
        $jiazhang_user = M('jiazhang_user')->field('phone,name,city,create_time')->order('create_time desc')->limit(5)->select();
        $this->assign('jiazhang_user',$jiazhang_user);

        $this->display();
    }
    
    //最新订单显示
    public function zhuce_order_iframe()
    {
        $sql = "select t1.id,t1.date,t1.grade,t1.subject,t1.time,t2.name as jz_name,t3.sfz_name as ls_name from jz_to_ls_yuyue t1 inner join jiazhang_user t2 on t1.jz_uid=t2.id inner join laoshi_user t3 on t1.ls_uid=t3.id order by t1.id desc limit 5";
        $jz_to_ls_yuyue = M()->query($sql);
        $this->assign('jz_to_ls_yuyue',$jz_to_ls_yuyue);

        $this->display();
    }
}